<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title></title>
  </head>
  <body>
    <div id="app">
      <btn-a></btn-a>
      
    </div>
    <script src="./vue.js"></script>
    <script>
      const vm=new Vue({
        el:'#app',
        data:{},
        methods:{},
        components:{
          "btn-a":{
            template:`<div>{{msg}}<btn-b></btn-b></div>`,
            data(){
              return {
                msg:"这是父组件"
              }
            },
            components:{
              "btn-b":{
                template:`<div>{{msg}}</div>`,
                data(){
                  return {
                    msg:"这是子组件"
                  }
                }
              }
            }

          }
        }
       })
    </script>
  </body>
</html>